# 分类商品模块下的所有资源

from flask import Blueprint
from flask_restful import Api
from common.utils.output import output_json

# 创建分类购物蓝图
index_bp = Blueprint('index',__name__)
index_api = Api(index_bp) # 蓝图中创建api

# 使用自定义的JSON格式，可以替代装饰器的写法
index_api.representation('application/json')(output_json)

# 添加资源类
from shopping.resource.index.index_resource import *

index_api.add_resource(Shopping_Category,'/category',endpoint='category')
index_api.add_resource(Shopping_HomeNewProduct,'/home_new_product',endpoint='home_new_product')
index_api.add_resource(Shopping_HomeRecommendProduct,'/home_recommend_product',endpoint='home_recommend_product')
index_api.add_resource(Shopping_RecommendSubject,'/recommend_subject',endpoint='recommend_subject')
